package Parser;

import java.util.ArrayList;

import LexicalAnalyzer.Token;

public abstract class Symbol {
	
	public long linenumber;
	public String semType = "invalid";
	public boolean lvalue = false; //unless specifically set to true
	String content;	
	public int type;
	public String place;
	public boolean deRef = false; //for use in code generation: whether the symbol is being dereferenced
	

	protected ArrayList<Symbol> children;
	
	public abstract boolean matches(Token t);
	
	public abstract boolean matches(String str);
	
	public abstract boolean isTerminal();
	
	public boolean addChild(Symbol s){
		return children.add(s);
	}

	public void setChildren(ArrayList<Symbol> ar){
		this.children=ar;
	}
	
	public ArrayList<Symbol> getChildren(){
		return this.children;
	}

	protected String toString(int i) {
		return this.toString();
	}
	
	public int getType(){
		return type;
	}
	
	public abstract String getContent();
}